/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = 'regional';
  @endpointMap = {
    cn-qingdao = 'dts.aliyuncs.com',
    cn-beijing = 'dts.aliyuncs.com',
    cn-zhangjiakou = 'dts.aliyuncs.com',
    cn-huhehaote = 'dts.aliyuncs.com',
    cn-hangzhou = 'dts.aliyuncs.com',
    cn-shanghai = 'dts.aliyuncs.com',
    cn-shenzhen = 'dts.aliyuncs.com',
    cn-hongkong = 'dts.aliyuncs.com',
    ap-southeast-1 = 'dts.aliyuncs.com',
    ap-southeast-2 = 'dts.aliyuncs.com',
    ap-southeast-3 = 'dts.aliyuncs.com',
    ap-southeast-5 = 'dts.aliyuncs.com',
    eu-west-1 = 'dts.aliyuncs.com',
    us-west-1 = 'dts.aliyuncs.com',
    us-east-1 = 'dts.aliyuncs.com',
    eu-central-1 = 'dts.aliyuncs.com',
    me-east-1 = 'dts.aliyuncs.com',
    ap-south-1 = 'dts.aliyuncs.com',
    cn-hangzhou-finance = 'dts.aliyuncs.com',
    cn-shanghai-finance-1 = 'dts.aliyuncs.com',
    cn-shenzhen-finance-1 = 'dts.aliyuncs.com',
    cn-north-2-gov-1 = 'dts.aliyuncs.com',
    ap-northeast-2-pop = 'dts.aliyuncs.com',
    cn-beijing-finance-1 = 'dts.aliyuncs.com',
    cn-beijing-finance-pop = 'dts.aliyuncs.com',
    cn-beijing-gov-1 = 'dts.aliyuncs.com',
    cn-beijing-nu16-b01 = 'dts.aliyuncs.com',
    cn-chengdu = 'dts.aliyuncs.com',
    cn-edge-1 = 'dts.aliyuncs.com',
    cn-fujian = 'dts.aliyuncs.com',
    cn-haidian-cm12-c01 = 'dts.aliyuncs.com',
    cn-hangzhou-bj-b01 = 'dts.aliyuncs.com',
    cn-hangzhou-internal-prod-1 = 'dts.aliyuncs.com',
    cn-hangzhou-internal-test-1 = 'dts.aliyuncs.com',
    cn-hangzhou-internal-test-2 = 'dts.aliyuncs.com',
    cn-hangzhou-internal-test-3 = 'dts.aliyuncs.com',
    cn-hangzhou-test-306 = 'dts.aliyuncs.com',
    cn-hongkong-finance-pop = 'dts.aliyuncs.com',
    cn-huhehaote-nebula-1 = 'dts.aliyuncs.com',
    cn-qingdao-nebula = 'dts.aliyuncs.com',
    cn-shanghai-et15-b01 = 'dts.aliyuncs.com',
    cn-shanghai-et2-b01 = 'dts.aliyuncs.com',
    cn-shanghai-inner = 'dts.aliyuncs.com',
    cn-shanghai-internal-test-1 = 'dts.aliyuncs.com',
    cn-shenzhen-inner = 'dts.aliyuncs.com',
    cn-shenzhen-st4-d01 = 'dts.aliyuncs.com',
    cn-shenzhen-su18-b01 = 'dts.aliyuncs.com',
    cn-wuhan = 'dts.aliyuncs.com',
    cn-wulanchabu = 'dts.aliyuncs.com',
    cn-yushanfang = 'dts.aliyuncs.com',
    cn-zhangbei-na61-b01 = 'dts.aliyuncs.com',
    cn-zhangjiakou-na62-a01 = 'dts.aliyuncs.com',
    cn-zhengzhou-nebula-1 = 'dts.aliyuncs.com',
    eu-west-1-oxs = 'dts.aliyuncs.com',
    rus-west-1-pop = 'dts.aliyuncs.com',
  };

  checkConfig(config);
  @endpoint = getEndpoint('dts', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model ConfigurationSynchronizationJobRequest {
  destinationEndpoint?: {
    instanceID?: string(name='InstanceID'),
    instanceType?: string(name='InstanceType'),
  }(name='DestinationEndpoint'),
  initialization?: {
    dataLoad?: boolean(name='DataLoad'),
    structureLoad?: boolean(name='StructureLoad'),
  }(name='Initialization'),
  sourceEndpoint?: {
    instanceID?: string(name='InstanceID'),
    instanceType?: string(name='InstanceType'),
  }(name='SourceEndpoint'),
  ownerId?: string(name='OwnerId'),
  synchronizationJobId?: string(name='SynchronizationJobId'),
  synchronizationJobName?: string(name='SynchronizationJobName'),
  synchronizationObject?: string(name='SynchronizationObject'),
}

model ConfigurationSynchronizationJobResponseBody = {
  errCode?: string(name='ErrCode'),
  errMessage?: string(name='ErrMessage'),
  requestId?: string(name='RequestId'),
  success?: string(name='Success'),
}

model ConfigurationSynchronizationJobResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ConfigurationSynchronizationJobResponseBody(name='body'),
}

async function configurationSynchronizationJobWithOptions(request: ConfigurationSynchronizationJobRequest, runtime: Util.RuntimeOptions): ConfigurationSynchronizationJobResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.synchronizationJobId)) {
    query['SynchronizationJobId'] = request.synchronizationJobId;
  }
  if (!Util.isUnset(request.synchronizationJobName)) {
    query['SynchronizationJobName'] = request.synchronizationJobName;
  }
  if (!Util.isUnset(request.synchronizationObject)) {
    query['SynchronizationObject'] = request.synchronizationObject;
  }
  if (!Util.isUnset(request.destinationEndpoint)) {
    query['DestinationEndpoint'] = request.destinationEndpoint;
  }
  if (!Util.isUnset(request.initialization)) {
    query['Initialization'] = request.initialization;
  }
  if (!Util.isUnset(request.sourceEndpoint)) {
    query['SourceEndpoint'] = request.sourceEndpoint;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ConfigurationSynchronizationJob',
    version = '2016-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function configurationSynchronizationJob(request: ConfigurationSynchronizationJobRequest): ConfigurationSynchronizationJobResponse {
  var runtime = new Util.RuntimeOptions{};
  return configurationSynchronizationJobWithOptions(request, runtime);
}

model ConfigureMigrationJobRequest {
  destinationEndpoint?: {
    dataBaseName?: string(name='DataBaseName'),
    engineName?: string(name='EngineName'),
    IP?: string(name='IP'),
    instanceID?: string(name='InstanceID'),
    instanceType?: string(name='InstanceType'),
    password?: string(name='Password'),
    port?: string(name='Port'),
    region?: string(name='Region'),
    userName?: string(name='UserName'),
  }(name='DestinationEndpoint'),
  migrationMode?: {
    dataIntialization?: boolean(name='DataIntialization'),
    dataSynchronization?: boolean(name='DataSynchronization'),
    structureIntialization?: boolean(name='StructureIntialization'),
  }(name='MigrationMode'),
  sourceEndpoint?: {
    databaseName?: string(name='DatabaseName'),
    engineName?: string(name='EngineName'),
    IP?: string(name='IP'),
    instanceID?: string(name='InstanceID'),
    instanceType?: string(name='InstanceType'),
    oracleSID?: string(name='OracleSID'),
    ownerID?: string(name='OwnerID'),
    password?: string(name='Password'),
    port?: string(name='Port'),
    region?: string(name='Region'),
    role?: string(name='Role'),
    userName?: string(name='UserName'),
  }(name='SourceEndpoint'),
  checkpoint?: string(name='Checkpoint'),
  migrationJobId?: string(name='MigrationJobId'),
  migrationJobName?: string(name='MigrationJobName'),
  migrationObject?: string(name='MigrationObject'),
  migrationReserved?: string(name='MigrationReserved'),
  ownerId?: string(name='OwnerId'),
}

model ConfigureMigrationJobResponseBody = {
  errCode?: string(name='ErrCode'),
  errMessage?: string(name='ErrMessage'),
  requestId?: string(name='RequestId'),
  success?: string(name='Success'),
}

model ConfigureMigrationJobResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ConfigureMigrationJobResponseBody(name='body'),
}

async function configureMigrationJobWithOptions(request: ConfigureMigrationJobRequest, runtime: Util.RuntimeOptions): ConfigureMigrationJobResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.checkpoint)) {
    query['Checkpoint'] = request.checkpoint;
  }
  if (!Util.isUnset(request.migrationJobId)) {
    query['MigrationJobId'] = request.migrationJobId;
  }
  if (!Util.isUnset(request.migrationJobName)) {
    query['MigrationJobName'] = request.migrationJobName;
  }
  if (!Util.isUnset(request.migrationObject)) {
    query['MigrationObject'] = request.migrationObject;
  }
  if (!Util.isUnset(request.migrationReserved)) {
    query['MigrationReserved'] = request.migrationReserved;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.destinationEndpoint)) {
    query['DestinationEndpoint'] = request.destinationEndpoint;
  }
  if (!Util.isUnset(request.migrationMode)) {
    query['MigrationMode'] = request.migrationMode;
  }
  if (!Util.isUnset(request.sourceEndpoint)) {
    query['SourceEndpoint'] = request.sourceEndpoint;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ConfigureMigrationJob',
    version = '2016-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function configureMigrationJob(request: ConfigureMigrationJobRequest): ConfigureMigrationJobResponse {
  var runtime = new Util.RuntimeOptions{};
  return configureMigrationJobWithOptions(request, runtime);
}

model ConfigureSubscriptionInstanceRequest {
  sourceEndpoint?: {
    instanceID?: string(name='InstanceID'),
    instanceType?: string(name='InstanceType'),
    ownerID?: string(name='OwnerID'),
    role?: string(name='Role'),
  }(name='SourceEndpoint'),
  subscriptionDataType?: {
    DDL?: boolean(name='DDL'),
    DML?: boolean(name='DML'),
  }(name='SubscriptionDataType'),
  ownerId?: string(name='OwnerId'),
  subscriptionInstanceId?: string(name='SubscriptionInstanceId'),
  subscriptionInstanceName?: string(name='SubscriptionInstanceName'),
  subscriptionObject?: string(name='SubscriptionObject'),
}

model ConfigureSubscriptionInstanceResponseBody = {
  errCode?: string(name='ErrCode'),
  errMessage?: string(name='ErrMessage'),
  requestId?: string(name='RequestId'),
  success?: string(name='Success'),
}

model ConfigureSubscriptionInstanceResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ConfigureSubscriptionInstanceResponseBody(name='body'),
}

async function configureSubscriptionInstanceWithOptions(request: ConfigureSubscriptionInstanceRequest, runtime: Util.RuntimeOptions): ConfigureSubscriptionInstanceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.subscriptionInstanceId)) {
    query['SubscriptionInstanceId'] = request.subscriptionInstanceId;
  }
  if (!Util.isUnset(request.subscriptionInstanceName)) {
    query['SubscriptionInstanceName'] = request.subscriptionInstanceName;
  }
  if (!Util.isUnset(request.subscriptionObject)) {
    query['SubscriptionObject'] = request.subscriptionObject;
  }
  if (!Util.isUnset(request.sourceEndpoint)) {
    query['SourceEndpoint'] = request.sourceEndpoint;
  }
  if (!Util.isUnset(request.subscriptionDataType)) {
    query['SubscriptionDataType'] = request.subscriptionDataType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ConfigureSubscriptionInstance',
    version = '2016-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function configureSubscriptionInstance(request: ConfigureSubscriptionInstanceRequest): ConfigureSubscriptionInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return configureSubscriptionInstanceWithOptions(request, runtime);
}

model ConfigureSynchronizationJobRequest {
  destinationEndpoint?: {
    IP?: string(name='IP'),
    instanceId?: string(name='InstanceId'),
    instanceType?: string(name='InstanceType'),
    password?: string(name='Password'),
    port?: string(name='Port'),
    userName?: string(name='UserName'),
  }(name='DestinationEndpoint'),
  partitionKey?: {
    modifyTimeDay?: boolean(name='ModifyTime_Day'),
    modifyTimeHour?: boolean(name='ModifyTime_Hour'),
    modifyTimeMinute?: boolean(name='ModifyTime_Minute'),
    modifyTimeMonth?: boolean(name='ModifyTime_Month'),
    modifyTimeYear?: boolean(name='ModifyTime_Year'),
  }(name='PartitionKey'),
  sourceEndpoint?: {
    IP?: string(name='IP'),
    instanceId?: string(name='InstanceId'),
    instanceType?: string(name='InstanceType'),
    ownerID?: string(name='OwnerID'),
    password?: string(name='Password'),
    port?: string(name='Port'),
    role?: string(name='Role'),
    userName?: string(name='UserName'),
  }(name='SourceEndpoint'),
  checkpoint?: string(name='Checkpoint'),
  dataInitialization?: boolean(name='DataInitialization'),
  migrationReserved?: string(name='MigrationReserved'),
  ownerId?: string(name='OwnerId'),
  structureInitialization?: boolean(name='StructureInitialization'),
  synchronizationJobId?: string(name='SynchronizationJobId'),
  synchronizationJobName?: string(name='SynchronizationJobName'),
  synchronizationObjects?: string(name='SynchronizationObjects'),
}

model ConfigureSynchronizationJobResponseBody = {
  errCode?: string(name='ErrCode'),
  errMessage?: string(name='ErrMessage'),
  requestId?: string(name='RequestId'),
  success?: string(name='Success'),
}

model ConfigureSynchronizationJobResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ConfigureSynchronizationJobResponseBody(name='body'),
}

async function configureSynchronizationJobWithOptions(request: ConfigureSynchronizationJobRequest, runtime: Util.RuntimeOptions): ConfigureSynchronizationJobResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.checkpoint)) {
    query['Checkpoint'] = request.checkpoint;
  }
  if (!Util.isUnset(request.dataInitialization)) {
    query['DataInitialization'] = request.dataInitialization;
  }
  if (!Util.isUnset(request.migrationReserved)) {
    query['MigrationReserved'] = request.migrationReserved;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.structureInitialization)) {
    query['StructureInitialization'] = request.structureInitialization;
  }
  if (!Util.isUnset(request.synchronizationJobId)) {
    query['SynchronizationJobId'] = request.synchronizationJobId;
  }
  if (!Util.isUnset(request.synchronizationJobName)) {
    query['SynchronizationJobName'] = request.synchronizationJobName;
  }
  if (!Util.isUnset(request.synchronizationObjects)) {
    query['SynchronizationObjects'] = request.synchronizationObjects;
  }
  if (!Util.isUnset(request.destinationEndpoint)) {
    query['DestinationEndpoint'] = request.destinationEndpoint;
  }
  if (!Util.isUnset(request.partitionKey)) {
    query['PartitionKey'] = request.partitionKey;
  }
  if (!Util.isUnset(request.sourceEndpoint)) {
    query['SourceEndpoint'] = request.sourceEndpoint;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ConfigureSynchronizationJob',
    version = '2016-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function configureSynchronizationJob(request: ConfigureSynchronizationJobRequest): ConfigureSynchronizationJobResponse {
  var runtime = new Util.RuntimeOptions{};
  return configureSynchronizationJobWithOptions(request, runtime);
}

model CreateMigrationJobRequest {
  clientToken?: string(name='ClientToken'),
  migrationJobClass?: string(name='MigrationJobClass'),
  ownerId?: string(name='OwnerId'),
  region?: string(name='Region'),
}

model CreateMigrationJobResponseBody = {
  errCode?: string(name='ErrCode'),
  errMessage?: string(name='ErrMessage'),
  migrationJobId?: string(name='MigrationJobId'),
  requestId?: string(name='RequestId'),
  success?: string(name='Success'),
}

model CreateMigrationJobResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateMigrationJobResponseBody(name='body'),
}

async function createMigrationJobWithOptions(request: CreateMigrationJobRequest, runtime: Util.RuntimeOptions): CreateMigrationJobResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.migrationJobClass)) {
    query['MigrationJobClass'] = request.migrationJobClass;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.region)) {
    query['Region'] = request.region;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateMigrationJob',
    version = '2016-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createMigrationJob(request: CreateMigrationJobRequest): CreateMigrationJobResponse {
  var runtime = new Util.RuntimeOptions{};
  return createMigrationJobWithOptions(request, runtime);
}

model CreateSubscriptionInstanceRequest {
  clientToken?: string(name='ClientToken'),
  ownerId?: string(name='OwnerId'),
  payType?: string(name='PayType'),
  period?: string(name='Period'),
  region?: string(name='Region'),
  usedTime?: int32(name='UsedTime'),
}

model CreateSubscriptionInstanceResponseBody = {
  errCode?: string(name='ErrCode'),
  errMessage?: string(name='ErrMessage'),
  requestId?: string(name='RequestId'),
  subscriptionInstanceId?: string(name='SubscriptionInstanceId'),
  success?: string(name='Success'),
}

model CreateSubscriptionInstanceResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateSubscriptionInstanceResponseBody(name='body'),
}

async function createSubscriptionInstanceWithOptions(request: CreateSubscriptionInstanceRequest, runtime: Util.RuntimeOptions): CreateSubscriptionInstanceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.payType)) {
    query['PayType'] = request.payType;
  }
  if (!Util.isUnset(request.period)) {
    query['Period'] = request.period;
  }
  if (!Util.isUnset(request.region)) {
    query['Region'] = request.region;
  }
  if (!Util.isUnset(request.usedTime)) {
    query['UsedTime'] = request.usedTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateSubscriptionInstance',
    version = '2016-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createSubscriptionInstance(request: CreateSubscriptionInstanceRequest): CreateSubscriptionInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return createSubscriptionInstanceWithOptions(request, runtime);
}

model CreateSynchronizationJobRequest {
  destinationEndpoint?: {
    instanceType?: string(name='InstanceType'),
  }(name='DestinationEndpoint'),
  sourceEndpoint?: {
    instanceType?: string(name='InstanceType'),
  }(name='SourceEndpoint'),
  clientToken?: string(name='ClientToken'),
  destRegion?: string(name='DestRegion'),
  ownerId?: string(name='OwnerId'),
  payType?: string(name='PayType'),
  period?: string(name='Period'),
  sourceRegion?: string(name='SourceRegion'),
  synchronizationJobClass?: string(name='SynchronizationJobClass'),
  usedTime?: int32(name='UsedTime'),
  networkType?: string(name='networkType'),
}

model CreateSynchronizationJobResponseBody = {
  errCode?: string(name='ErrCode'),
  errMessage?: string(name='ErrMessage'),
  requestId?: string(name='RequestId'),
  success?: string(name='Success'),
  synchronizationJobId?: string(name='SynchronizationJobId'),
}

model CreateSynchronizationJobResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateSynchronizationJobResponseBody(name='body'),
}

async function createSynchronizationJobWithOptions(request: CreateSynchronizationJobRequest, runtime: Util.RuntimeOptions): CreateSynchronizationJobResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.destRegion)) {
    query['DestRegion'] = request.destRegion;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.payType)) {
    query['PayType'] = request.payType;
  }
  if (!Util.isUnset(request.period)) {
    query['Period'] = request.period;
  }
  if (!Util.isUnset(request.sourceRegion)) {
    query['SourceRegion'] = request.sourceRegion;
  }
  if (!Util.isUnset(request.synchronizationJobClass)) {
    query['SynchronizationJobClass'] = request.synchronizationJobClass;
  }
  if (!Util.isUnset(request.usedTime)) {
    query['UsedTime'] = request.usedTime;
  }
  if (!Util.isUnset(request.networkType)) {
    query['networkType'] = request.networkType;
  }
  if (!Util.isUnset(request.destinationEndpoint)) {
    query['DestinationEndpoint'] = request.destinationEndpoint;
  }
  if (!Util.isUnset(request.sourceEndpoint)) {
    query['SourceEndpoint'] = request.sourceEndpoint;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateSynchronizationJob',
    version = '2016-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createSynchronizationJob(request: CreateSynchronizationJobRequest): CreateSynchronizationJobResponse {
  var runtime = new Util.RuntimeOptions{};
  return createSynchronizationJobWithOptions(request, runtime);
}

model DeleteMigrationJobRequest {
  migrationJobId?: string(name='MigrationJobId'),
  ownerId?: string(name='OwnerId'),
}

model DeleteMigrationJobResponseBody = {
  errCode?: string(name='ErrCode'),
  errMessage?: string(name='ErrMessage'),
  requestId?: string(name='RequestId'),
  success?: string(name='Success'),
}

model DeleteMigrationJobResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteMigrationJobResponseBody(name='body'),
}

async function deleteMigrationJobWithOptions(request: DeleteMigrationJobRequest, runtime: Util.RuntimeOptions): DeleteMigrationJobResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.migrationJobId)) {
    query['MigrationJobId'] = request.migrationJobId;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteMigrationJob',
    version = '2016-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteMigrationJob(request: DeleteMigrationJobRequest): DeleteMigrationJobResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteMigrationJobWithOptions(request, runtime);
}

model DeleteSubscriptionInstanceRequest {
  ownerId?: string(name='OwnerId'),
  subscriptionInstanceId?: string(name='SubscriptionInstanceId'),
}

model DeleteSubscriptionInstanceResponseBody = {
  errCode?: string(name='ErrCode'),
  errMessage?: string(name='ErrMessage'),
  requestId?: string(name='RequestId'),
  success?: string(name='Success'),
}

model DeleteSubscriptionInstanceResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteSubscriptionInstanceResponseBody(name='body'),
}

async function deleteSubscriptionInstanceWithOptions(request: DeleteSubscriptionInstanceRequest, runtime: Util.RuntimeOptions): DeleteSubscriptionInstanceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.subscriptionInstanceId)) {
    query['SubscriptionInstanceId'] = request.subscriptionInstanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteSubscriptionInstance',
    version = '2016-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteSubscriptionInstance(request: DeleteSubscriptionInstanceRequest): DeleteSubscriptionInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteSubscriptionInstanceWithOptions(request, runtime);
}

model DeleteSynchronizationJobRequest {
  ownerId?: string(name='OwnerId'),
  synchronizationJobId?: string(name='SynchronizationJobId'),
}

model DeleteSynchronizationJobResponseBody = {
  errCode?: string(name='ErrCode'),
  errMessage?: string(name='ErrMessage'),
  requestId?: string(name='RequestId'),
  success?: string(name='Success'),
}

model DeleteSynchronizationJobResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteSynchronizationJobResponseBody(name='body'),
}

async function deleteSynchronizationJobWithOptions(request: DeleteSynchronizationJobRequest, runtime: Util.RuntimeOptions): DeleteSynchronizationJobResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.synchronizationJobId)) {
    query['SynchronizationJobId'] = request.synchronizationJobId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteSynchronizationJob',
    version = '2016-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteSynchronizationJob(request: DeleteSynchronizationJobRequest): DeleteSynchronizationJobResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteSynchronizationJobWithOptions(request, runtime);
}

model DescirbeMigrationJobsRequest {
  migrationJobName?: string(name='MigrationJobName'),
  ownerId?: string(name='OwnerId'),
  pageNum?: int32(name='PageNum'),
  pageSize?: int32(name='PageSize'),
}

model DescirbeMigrationJobsResponseBody = {
  migrationJobs?: {
    migrationJob?: [ 
    {
      dataInitialization?: {
        errorMessage?: string(name='ErrorMessage'),
        percent?: string(name='Percent'),
        progress?: string(name='Progress'),
        status?: string(name='status'),
      }(name='DataInitialization'),
      dataSynchronization?: {
        delay?: string(name='Delay'),
        errorMessage?: string(name='ErrorMessage'),
        percent?: string(name='Percent'),
        status?: string(name='status'),
      }(name='DataSynchronization'),
      destinationEndpoint?: {
        databaseName?: string(name='DatabaseName'),
        engineName?: string(name='EngineName'),
        IP?: string(name='IP'),
        instanceID?: string(name='InstanceID'),
        instanceType?: string(name='InstanceType'),
        oracleSID?: string(name='OracleSID'),
        port?: string(name='Port'),
        userName?: string(name='UserName'),
      }(name='DestinationEndpoint'),
      migrationJobClass?: string(name='MigrationJobClass'),
      migrationJobID?: string(name='MigrationJobID'),
      migrationJobName?: string(name='MigrationJobName'),
      migrationJobStatus?: string(name='MigrationJobStatus'),
      migrationMode?: {
        dataInitialization?: boolean(name='DataInitialization'),
        dataSynchronization?: boolean(name='DataSynchronization'),
        structureInitialization?: boolean(name='StructureInitialization'),
      }(name='MigrationMode'),
      migrationObject?: {
        synchronousObject?: [ 
        {
          databaseName?: string(name='DatabaseName'),
          tableList?: {
            table?: [ string ](name='Table')
          }(name='TableList'),
          wholeDatabase?: string(name='WholeDatabase'),
        }
      ](name='SynchronousObject')
      }(name='MigrationObject'),
      payType?: string(name='PayType'),
      precheck?: {
        percent?: string(name='Percent'),
        status?: string(name='Status'),
      }(name='Precheck'),
      sourceEndpoint?: {
        databaseName?: string(name='DatabaseName'),
        engineName?: string(name='EngineName'),
        IP?: string(name='IP'),
        instanceID?: string(name='InstanceID'),
        instanceType?: string(name='InstanceType'),
        oracleSID?: string(name='OracleSID'),
        port?: string(name='Port'),
        userName?: string(name='UserName'),
      }(name='SourceEndpoint'),
      structureInitialization?: {
        errorMessage?: string(name='ErrorMessage'),
        percent?: string(name='Percent'),
        progress?: string(name='Progress'),
        status?: string(name='status'),
      }(name='StructureInitialization'),
    }
  ](name='MigrationJob')
  }(name='MigrationJobs'),
  pageNumber?: int32(name='PageNumber'),
  pageRecordCount?: int32(name='PageRecordCount'),
  totalRecordCount?: long(name='TotalRecordCount'),
}

model DescirbeMigrationJobsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescirbeMigrationJobsResponseBody(name='body'),
}

async function descirbeMigrationJobsWithOptions(request: DescirbeMigrationJobsRequest, runtime: Util.RuntimeOptions): DescirbeMigrationJobsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.migrationJobName)) {
    query['MigrationJobName'] = request.migrationJobName;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNum)) {
    query['PageNum'] = request.pageNum;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescirbeMigrationJobs',
    version = '2016-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function descirbeMigrationJobs(request: DescirbeMigrationJobsRequest): DescirbeMigrationJobsResponse {
  var runtime = new Util.RuntimeOptions{};
  return descirbeMigrationJobsWithOptions(request, runtime);
}

model DescribeInitializationStatusRequest {
  ownerId?: string(name='OwnerId'),
  pageNum?: int32(name='PageNum'),
  pageSize?: int32(name='PageSize'),
  synchronizationJobId?: string(name='SynchronizationJobId'),
}

model DescribeInitializationStatusResponseBody = {
  dataInitializationDetails?: [ 
    {
      destinationOwnerDBName?: string(name='DestinationOwnerDBName'),
      errorMessage?: string(name='ErrorMessage'),
      finishRowNum?: string(name='FinishRowNum'),
      sourceOwnerDBName?: string(name='SourceOwnerDBName'),
      status?: string(name='Status'),
      tableName?: string(name='TableName'),
      totalRowNum?: string(name='TotalRowNum'),
      usedTime?: string(name='UsedTime'),
    }
  ](name='DataInitializationDetails'),
  dataSynchronizationDetails?: [ 
    {
      destinationOwnerDBName?: string(name='DestinationOwnerDBName'),
      errorMessage?: string(name='ErrorMessage'),
      sourceOwnerDBName?: string(name='SourceOwnerDBName'),
      status?: string(name='Status'),
      tableName?: string(name='TableName'),
    }
  ](name='DataSynchronizationDetails'),
  structureInitializationDetails?: [ 
    {
      constraints?: [ 
        {
          destinationOwnerDBName?: string(name='DestinationOwnerDBName'),
          errorMessage?: string(name='ErrorMessage'),
          objectDefinition?: string(name='ObjectDefinition'),
          objectName?: string(name='ObjectName'),
          objectType?: string(name='ObjectType'),
          sourceOwnerDBName?: string(name='SourceOwnerDBName'),
          status?: string(name='Status'),
        }
      ](name='Constraints'),
      destinationOwnerDBName?: string(name='DestinationOwnerDBName'),
      errorMessage?: string(name='ErrorMessage'),
      objectDefinition?: string(name='ObjectDefinition'),
      objectName?: string(name='ObjectName'),
      objectType?: string(name='ObjectType'),
      sourceOwnerDBName?: string(name='SourceOwnerDBName'),
      status?: string(name='Status'),
    }
  ](name='StructureInitializationDetails'),
}

model DescribeInitializationStatusResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeInitializationStatusResponseBody(name='body'),
}

async function describeInitializationStatusWithOptions(request: DescribeInitializationStatusRequest, runtime: Util.RuntimeOptions): DescribeInitializationStatusResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNum)) {
    query['PageNum'] = request.pageNum;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.synchronizationJobId)) {
    query['SynchronizationJobId'] = request.synchronizationJobId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeInitializationStatus',
    version = '2016-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeInitializationStatus(request: DescribeInitializationStatusRequest): DescribeInitializationStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeInitializationStatusWithOptions(request, runtime);
}

model DescribeMigrationJobDetailRequest {
  migrationMode?: {
    dataInitialization?: boolean(name='DataInitialization'),
    dataSynchronization?: boolean(name='DataSynchronization'),
    structureInitialization?: boolean(name='StructureInitialization'),
  }(name='MigrationMode'),
  clientToken?: string(name='ClientToken'),
  migrationJobId?: string(name='MigrationJobId'),
  ownerId?: string(name='OwnerId'),
  pageNum?: int32(name='PageNum'),
  pageSize?: int32(name='PageSize'),
}

model DescribeMigrationJobDetailResponseBody = {
  dataInitializationDetailList?: {
    dataInitializationDetail?: [ 
    {
      destinationOwnerDBName?: string(name='DestinationOwnerDBName'),
      errorMessage?: string(name='ErrorMessage'),
      finishRowNum?: string(name='FinishRowNum'),
      migrationTime?: string(name='MigrationTime'),
      sourceOwnerDBName?: string(name='SourceOwnerDBName'),
      status?: string(name='Status'),
      tableName?: string(name='TableName'),
      totalRowNum?: string(name='TotalRowNum'),
    }
  ](name='DataInitializationDetail')
  }(name='DataInitializationDetailList'),
  dataSynchronizationDetailList?: {
    dataSynchronizationDetail?: [ 
    {
      destinationOwnerDBName?: string(name='DestinationOwnerDBName'),
      errorMessage?: string(name='ErrorMessage'),
      sourceOwnerDBName?: string(name='SourceOwnerDBName'),
      status?: string(name='Status'),
      tableName?: string(name='TableName'),
    }
  ](name='DataSynchronizationDetail')
  }(name='DataSynchronizationDetailList'),
  pageNumber?: int32(name='PageNumber'),
  pageRecordCount?: int32(name='PageRecordCount'),
  structureInitializationDetailList?: {
    structureInitializationDetail?: [ 
    {
      constraintList?: {
        structureInitializationDetail?: [ 
        {
          destinationOwnerDBName?: string(name='DestinationOwnerDBName'),
          errorMessage?: string(name='ErrorMessage'),
          objectDefinition?: string(name='ObjectDefinition'),
          objectName?: string(name='ObjectName'),
          objectType?: string(name='ObjectType'),
          sourceOwnerDBName?: string(name='SourceOwnerDBName'),
          status?: string(name='Status'),
        }
      ](name='StructureInitializationDetail')
      }(name='ConstraintList'),
      destinationOwnerDBName?: string(name='DestinationOwnerDBName'),
      errorMessage?: string(name='ErrorMessage'),
      objectDefinition?: string(name='ObjectDefinition'),
      objectName?: string(name='ObjectName'),
      objectType?: string(name='ObjectType'),
      sourceOwnerDBName?: string(name='SourceOwnerDBName'),
      status?: string(name='Status'),
    }
  ](name='StructureInitializationDetail')
  }(name='StructureInitializationDetailList'),
  totalRecordCount?: long(name='TotalRecordCount'),
}

model DescribeMigrationJobDetailResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeMigrationJobDetailResponseBody(name='body'),
}

async function describeMigrationJobDetailWithOptions(request: DescribeMigrationJobDetailRequest, runtime: Util.RuntimeOptions): DescribeMigrationJobDetailResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.migrationJobId)) {
    query['MigrationJobId'] = request.migrationJobId;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNum)) {
    query['PageNum'] = request.pageNum;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.migrationMode)) {
    query['MigrationMode'] = request.migrationMode;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeMigrationJobDetail',
    version = '2016-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeMigrationJobDetail(request: DescribeMigrationJobDetailRequest): DescribeMigrationJobDetailResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeMigrationJobDetailWithOptions(request, runtime);
}

model DescribeMigrationJobStatusRequest {
  clientToken?: string(name='ClientToken'),
  migrationJobId?: string(name='MigrationJobId'),
  ownerId?: string(name='OwnerId'),
}

model DescribeMigrationJobStatusResponseBody = {
  dataInitializationStatus?: {
    errorMessage?: string(name='ErrorMessage'),
    percent?: string(name='Percent'),
    progress?: string(name='Progress'),
    status?: string(name='Status'),
  }(name='DataInitializationStatus'),
  dataSynchronizationStatus?: {
    checkpoint?: string(name='Checkpoint'),
    delay?: string(name='Delay'),
    errorMessage?: string(name='ErrorMessage'),
    percent?: string(name='Percent'),
    status?: string(name='Status'),
  }(name='DataSynchronizationStatus'),
  destinationEndpoint?: {
    databaseName?: string(name='DatabaseName'),
    engineName?: string(name='EngineName'),
    IP?: string(name='IP'),
    instanceId?: string(name='InstanceId'),
    instanceType?: string(name='InstanceType'),
    port?: string(name='Port'),
    userName?: string(name='UserName'),
    oracleSID?: string(name='oracleSID'),
  }(name='DestinationEndpoint'),
  migrationJobClass?: string(name='MigrationJobClass'),
  migrationJobId?: string(name='MigrationJobId'),
  migrationJobName?: string(name='MigrationJobName'),
  migrationJobStatus?: string(name='MigrationJobStatus'),
  migrationMode?: {
    dataInitialization?: boolean(name='dataInitialization'),
    dataSynchronization?: boolean(name='dataSynchronization'),
    structureInitialization?: boolean(name='structureInitialization'),
  }(name='MigrationMode'),
  migrationObject?: string(name='MigrationObject'),
  payType?: string(name='PayType'),
  precheckStatus?: {
    detail?: {
      checkItem?: [ 
      {
        checkStatus?: string(name='CheckStatus'),
        errorMessage?: string(name='ErrorMessage'),
        itemName?: string(name='ItemName'),
        repairMethod?: string(name='RepairMethod'),
      }
    ](name='CheckItem')
    }(name='Detail'),
    percent?: string(name='Percent'),
    status?: string(name='Status'),
  }(name='PrecheckStatus'),
  sourceEndpoint?: {
    databaseName?: string(name='DatabaseName'),
    engineName?: string(name='EngineName'),
    IP?: string(name='IP'),
    instanceId?: string(name='InstanceId'),
    instanceType?: string(name='InstanceType'),
    port?: string(name='Port'),
    userName?: string(name='UserName'),
    oracleSID?: string(name='oracleSID'),
  }(name='SourceEndpoint'),
  structureInitializationStatus?: {
    errorMessage?: string(name='ErrorMessage'),
    percent?: string(name='Percent'),
    progress?: string(name='Progress'),
    status?: string(name='Status'),
  }(name='StructureInitializationStatus'),
}

model DescribeMigrationJobStatusResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeMigrationJobStatusResponseBody(name='body'),
}

async function describeMigrationJobStatusWithOptions(request: DescribeMigrationJobStatusRequest, runtime: Util.RuntimeOptions): DescribeMigrationJobStatusResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.migrationJobId)) {
    query['MigrationJobId'] = request.migrationJobId;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeMigrationJobStatus',
    version = '2016-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeMigrationJobStatus(request: DescribeMigrationJobStatusRequest): DescribeMigrationJobStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeMigrationJobStatusWithOptions(request, runtime);
}

model DescribeMigrationJobsRequest {
  migrationJobName?: string(name='MigrationJobName'),
  ownerId?: string(name='OwnerId'),
  pageNum?: int32(name='PageNum'),
  pageSize?: int32(name='PageSize'),
}

model DescribeMigrationJobsResponseBody = {
  migrationJobs?: {
    migrationJob?: [ 
    {
      dataInitialization?: {
        errorMessage?: string(name='ErrorMessage'),
        percent?: string(name='Percent'),
        progress?: string(name='Progress'),
        status?: string(name='status'),
      }(name='DataInitialization'),
      dataSynchronization?: {
        delay?: string(name='Delay'),
        errorMessage?: string(name='ErrorMessage'),
        percent?: string(name='Percent'),
        status?: string(name='status'),
      }(name='DataSynchronization'),
      destinationEndpoint?: {
        databaseName?: string(name='DatabaseName'),
        engineName?: string(name='EngineName'),
        IP?: string(name='IP'),
        instanceID?: string(name='InstanceID'),
        instanceType?: string(name='InstanceType'),
        oracleSID?: string(name='OracleSID'),
        port?: string(name='Port'),
        userName?: string(name='UserName'),
      }(name='DestinationEndpoint'),
      migrationJobClass?: string(name='MigrationJobClass'),
      migrationJobID?: string(name='MigrationJobID'),
      migrationJobName?: string(name='MigrationJobName'),
      migrationJobStatus?: string(name='MigrationJobStatus'),
      migrationMode?: {
        dataInitialization?: boolean(name='DataInitialization'),
        dataSynchronization?: boolean(name='DataSynchronization'),
        structureInitialization?: boolean(name='StructureInitialization'),
      }(name='MigrationMode'),
      migrationObject?: {
        synchronousObject?: [ 
        {
          databaseName?: string(name='DatabaseName'),
          tableList?: {
            table?: [ string ](name='Table')
          }(name='TableList'),
          wholeDatabase?: string(name='WholeDatabase'),
        }
      ](name='SynchronousObject')
      }(name='MigrationObject'),
      payType?: string(name='PayType'),
      precheck?: {
        percent?: string(name='Percent'),
        status?: string(name='Status'),
      }(name='Precheck'),
      sourceEndpoint?: {
        databaseName?: string(name='DatabaseName'),
        engineName?: string(name='EngineName'),
        IP?: string(name='IP'),
        instanceID?: string(name='InstanceID'),
        instanceType?: string(name='InstanceType'),
        oracleSID?: string(name='OracleSID'),
        port?: string(name='Port'),
        userName?: string(name='UserName'),
      }(name='SourceEndpoint'),
      structureInitialization?: {
        errorMessage?: string(name='ErrorMessage'),
        percent?: string(name='Percent'),
        progress?: string(name='Progress'),
        status?: string(name='status'),
      }(name='StructureInitialization'),
    }
  ](name='MigrationJob')
  }(name='MigrationJobs'),
  pageNumber?: int32(name='PageNumber'),
  pageRecordCount?: int32(name='PageRecordCount'),
  totalRecordCount?: long(name='TotalRecordCount'),
}

model DescribeMigrationJobsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeMigrationJobsResponseBody(name='body'),
}

async function describeMigrationJobsWithOptions(request: DescribeMigrationJobsRequest, runtime: Util.RuntimeOptions): DescribeMigrationJobsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.migrationJobName)) {
    query['MigrationJobName'] = request.migrationJobName;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNum)) {
    query['PageNum'] = request.pageNum;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeMigrationJobs',
    version = '2016-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeMigrationJobs(request: DescribeMigrationJobsRequest): DescribeMigrationJobsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeMigrationJobsWithOptions(request, runtime);
}

model DescribeSubscriptionInstanceStatusRequest {
  ownerId?: string(name='OwnerId'),
  subscriptionInstanceId?: string(name='SubscriptionInstanceId'),
}

model DescribeSubscriptionInstanceStatusResponseBody = {
  beginTimestamp?: string(name='BeginTimestamp'),
  consumptionCheckpoint?: string(name='ConsumptionCheckpoint'),
  consumptionClient?: string(name='ConsumptionClient'),
  endTimestamp?: string(name='EndTimestamp'),
  errorMessage?: string(name='ErrorMessage'),
  payType?: string(name='PayType'),
  sourceEndpoint?: {
    instanceID?: string(name='InstanceID'),
    instanceType?: string(name='InstanceType'),
  }(name='SourceEndpoint'),
  status?: string(name='Status'),
  subscriptionDataType?: {
    DDL?: boolean(name='DDL'),
    DML?: boolean(name='DML'),
  }(name='SubscriptionDataType'),
  subscriptionInstanceID?: string(name='SubscriptionInstanceID'),
  subscriptionInstanceName?: string(name='SubscriptionInstanceName'),
  subscriptionObject?: {
    synchronousObject?: [ 
    {
      databaseName?: string(name='DatabaseName'),
      tableList?: {
        table?: [ string ](name='Table')
      }(name='TableList'),
      wholeDatabase?: string(name='WholeDatabase'),
    }
  ](name='SynchronousObject')
  }(name='SubscriptionObject'),
}

model DescribeSubscriptionInstanceStatusResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeSubscriptionInstanceStatusResponseBody(name='body'),
}

async function describeSubscriptionInstanceStatusWithOptions(request: DescribeSubscriptionInstanceStatusRequest, runtime: Util.RuntimeOptions): DescribeSubscriptionInstanceStatusResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.subscriptionInstanceId)) {
    query['SubscriptionInstanceId'] = request.subscriptionInstanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSubscriptionInstanceStatus',
    version = '2016-08-01',
    protocol = 'HTTP',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeSubscriptionInstanceStatus(request: DescribeSubscriptionInstanceStatusRequest): DescribeSubscriptionInstanceStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSubscriptionInstanceStatusWithOptions(request, runtime);
}

model DescribeSubscriptionInstancesRequest {
  clientToken?: string(name='ClientToken'),
  ownerId?: string(name='OwnerId'),
  pageNum?: int32(name='PageNum'),
  pageSize?: int32(name='PageSize'),
  subscriptionInstanceName?: string(name='SubscriptionInstanceName'),
}

model DescribeSubscriptionInstancesResponseBody = {
  pageNumber?: int32(name='PageNumber'),
  pageRecordCount?: int32(name='PageRecordCount'),
  subscriptionInstances?: {
    subscriptionInstance?: [ 
    {
      beginTimestamp?: string(name='BeginTimestamp'),
      consumptionCheckpoint?: string(name='ConsumptionCheckpoint'),
      consumptionClient?: string(name='ConsumptionClient'),
      endTimestamp?: string(name='EndTimestamp'),
      errorMessage?: string(name='ErrorMessage'),
      payType?: string(name='PayType'),
      sourceEndpoint?: {
        instanceID?: string(name='InstanceID'),
        instanceType?: string(name='InstanceType'),
      }(name='SourceEndpoint'),
      status?: string(name='Status'),
      subscriptionDataType?: {
        DDL?: boolean(name='DDL'),
        DML?: boolean(name='DML'),
      }(name='SubscriptionDataType'),
      subscriptionInstanceID?: string(name='SubscriptionInstanceID'),
      subscriptionInstanceName?: string(name='SubscriptionInstanceName'),
      subscriptionObject?: {
        synchronousObject?: [ 
        {
          databaseName?: string(name='DatabaseName'),
          tableList?: {
            table?: [ string ](name='Table')
          }(name='TableList'),
          wholeDatabase?: string(name='WholeDatabase'),
        }
      ](name='SynchronousObject')
      }(name='SubscriptionObject'),
    }
  ](name='SubscriptionInstance')
  }(name='SubscriptionInstances'),
  totalRecordCount?: long(name='TotalRecordCount'),
}

model DescribeSubscriptionInstancesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeSubscriptionInstancesResponseBody(name='body'),
}

async function describeSubscriptionInstancesWithOptions(request: DescribeSubscriptionInstancesRequest, runtime: Util.RuntimeOptions): DescribeSubscriptionInstancesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNum)) {
    query['PageNum'] = request.pageNum;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.subscriptionInstanceName)) {
    query['SubscriptionInstanceName'] = request.subscriptionInstanceName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSubscriptionInstances',
    version = '2016-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeSubscriptionInstances(request: DescribeSubscriptionInstancesRequest): DescribeSubscriptionInstancesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSubscriptionInstancesWithOptions(request, runtime);
}

model DescribeSubscriptionObjectModifyStatusRequest {
  clientToken?: string(name='ClientToken'),
  ownerId?: string(name='OwnerId'),
  subscriptionInstanceId?: string(name='SubscriptionInstanceId'),
}

model DescribeSubscriptionObjectModifyStatusResponseBody = {
  detail?: {
    checkItem?: [ 
    {
      checkStatus?: string(name='CheckStatus'),
      errorMessage?: string(name='ErrorMessage'),
      itemName?: string(name='ItemName'),
      repairMethod?: string(name='RepairMethod'),
    }
  ](name='CheckItem')
  }(name='Detail'),
  percent?: string(name='Percent'),
  requestId?: string(name='RequestId'),
  status?: string(name='Status'),
}

model DescribeSubscriptionObjectModifyStatusResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeSubscriptionObjectModifyStatusResponseBody(name='body'),
}

async function describeSubscriptionObjectModifyStatusWithOptions(request: DescribeSubscriptionObjectModifyStatusRequest, runtime: Util.RuntimeOptions): DescribeSubscriptionObjectModifyStatusResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.subscriptionInstanceId)) {
    query['SubscriptionInstanceId'] = request.subscriptionInstanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSubscriptionObjectModifyStatus',
    version = '2016-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeSubscriptionObjectModifyStatus(request: DescribeSubscriptionObjectModifyStatusRequest): DescribeSubscriptionObjectModifyStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSubscriptionObjectModifyStatusWithOptions(request, runtime);
}

model DescribeSynchronizationJobStatusRequest {
  clientToken?: string(name='ClientToken'),
  ownerId?: string(name='OwnerId'),
  synchronizationJobId?: string(name='SynchronizationJobId'),
}

model DescribeSynchronizationJobStatusResponseBody = {
  checkpoint?: string(name='Checkpoint'),
  dataInitialization?: string(name='DataInitialization'),
  dataInitializationStatus?: {
    errorMessage?: string(name='ErrorMessage'),
    percent?: string(name='Percent'),
    progress?: string(name='Progress'),
    status?: string(name='Status'),
  }(name='DataInitializationStatus'),
  dataSynchronizationStatus?: {
    checkpoint?: string(name='Checkpoint'),
    delay?: string(name='Delay'),
    errorMessage?: string(name='ErrorMessage'),
    percent?: string(name='Percent'),
    status?: string(name='Status'),
  }(name='DataSynchronizationStatus'),
  delay?: string(name='Delay'),
  destinationEndpoint?: {
    instanceId?: string(name='InstanceId'),
    instanceType?: string(name='InstanceType'),
  }(name='DestinationEndpoint'),
  errorMessage?: string(name='ErrorMessage'),
  expireTime?: string(name='ExpireTime'),
  payType?: string(name='PayType'),
  performance?: {
    FLOW?: string(name='FLOW'),
    RPS?: string(name='RPS'),
  }(name='Performance'),
  precheckStatus?: {
    detail?: [ 
      {
        checkStatus?: string(name='CheckStatus'),
        errorMessage?: string(name='ErrorMessage'),
        itemName?: string(name='ItemName'),
        repairMethod?: string(name='RepairMethod'),
      }
    ](name='Detail'),
    percent?: string(name='Percent'),
    status?: string(name='Status'),
  }(name='PrecheckStatus'),
  requestId?: string(name='RequestId'),
  sourceEndpoint?: {
    instanceId?: string(name='InstanceId'),
    instanceType?: string(name='InstanceType'),
  }(name='SourceEndpoint'),
  status?: string(name='Status'),
  structureInitialization?: string(name='StructureInitialization'),
  structureInitializationStatus?: {
    errorMessage?: string(name='ErrorMessage'),
    percent?: string(name='Percent'),
    progress?: string(name='Progress'),
    status?: string(name='Status'),
  }(name='StructureInitializationStatus'),
  synchronizationJobClass?: string(name='SynchronizationJobClass'),
  synchronizationJobId?: string(name='SynchronizationJobId'),
  synchronizationJobName?: string(name='SynchronizationJobName'),
  synchronizationObjects?: [ 
    {
      newSchemaName?: string(name='NewSchemaName'),
      schemaName?: string(name='SchemaName'),
      tableExcludes?: [ 
        {
          tableName?: string(name='TableName'),
        }
      ](name='TableExcludes'),
      tableIncludes?: [ 
        {
          tableName?: string(name='TableName'),
        }
      ](name='TableIncludes'),
    }
  ](name='SynchronizationObjects'),
}

model DescribeSynchronizationJobStatusResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeSynchronizationJobStatusResponseBody(name='body'),
}

async function describeSynchronizationJobStatusWithOptions(request: DescribeSynchronizationJobStatusRequest, runtime: Util.RuntimeOptions): DescribeSynchronizationJobStatusResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.synchronizationJobId)) {
    query['SynchronizationJobId'] = request.synchronizationJobId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSynchronizationJobStatus',
    version = '2016-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeSynchronizationJobStatus(request: DescribeSynchronizationJobStatusRequest): DescribeSynchronizationJobStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSynchronizationJobStatusWithOptions(request, runtime);
}

model DescribeSynchronizationJobsRequest {
  clientToken?: string(name='ClientToken'),
  ownerId?: string(name='OwnerId'),
  pageNum?: int32(name='PageNum'),
  pageSize?: int32(name='PageSize'),
  synchronizationJobName?: string(name='SynchronizationJobName'),
}

model DescribeSynchronizationJobsResponseBody = {
  pageNumber?: int32(name='PageNumber'),
  pageRecordCount?: int32(name='PageRecordCount'),
  requestId?: string(name='RequestId'),
  synchronizationInstances?: [ 
    {
      dataInitialization?: string(name='DataInitialization'),
      dataInitializationStatus?: {
        errorMessage?: string(name='ErrorMessage'),
        percent?: string(name='Percent'),
        progress?: string(name='Progress'),
        status?: string(name='Status'),
      }(name='DataInitializationStatus'),
      dataSynchronizationStatus?: {
        delay?: string(name='Delay'),
        errorMessage?: string(name='ErrorMessage'),
        percent?: string(name='Percent'),
        status?: string(name='Status'),
      }(name='DataSynchronizationStatus'),
      delay?: string(name='Delay'),
      destinationEndpoint?: {
        instanceId?: string(name='InstanceId'),
        instanceType?: string(name='InstanceType'),
      }(name='DestinationEndpoint'),
      errorMessage?: string(name='ErrorMessage'),
      expireTime?: string(name='ExpireTime'),
      payType?: string(name='PayType'),
      performance?: {
        FLOW?: string(name='FLOW'),
        RPS?: string(name='RPS'),
      }(name='Performance'),
      precheckStatus?: {
        detail?: [ 
          {
            checkStatus?: string(name='CheckStatus'),
            errorMessage?: string(name='ErrorMessage'),
            itemName?: string(name='ItemName'),
            repairMethod?: string(name='RepairMethod'),
          }
        ](name='Detail'),
        percent?: string(name='Percent'),
        status?: string(name='Status'),
      }(name='PrecheckStatus'),
      sourceEndpoint?: {
        instanceId?: string(name='InstanceId'),
        instanceType?: string(name='InstanceType'),
      }(name='SourceEndpoint'),
      status?: string(name='Status'),
      structureInitialization?: string(name='StructureInitialization'),
      structureInitializationStatus?: {
        errorMessage?: string(name='ErrorMessage'),
        percent?: string(name='Percent'),
        progress?: string(name='Progress'),
        status?: string(name='Status'),
      }(name='StructureInitializationStatus'),
      synchronizationJobClass?: string(name='SynchronizationJobClass'),
      synchronizationJobId?: string(name='SynchronizationJobId'),
      synchronizationJobName?: string(name='SynchronizationJobName'),
      synchronizationObjects?: [ 
        {
          newSchemaName?: string(name='NewSchemaName'),
          schemaName?: string(name='SchemaName'),
          tableExcludes?: [ 
            {
              tableName?: string(name='TableName'),
            }
          ](name='TableExcludes'),
          tableIncludes?: [ 
            {
              tableName?: string(name='TableName'),
            }
          ](name='TableIncludes'),
        }
      ](name='SynchronizationObjects'),
    }
  ](name='SynchronizationInstances'),
  totalRecordCount?: long(name='TotalRecordCount'),
}

model DescribeSynchronizationJobsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeSynchronizationJobsResponseBody(name='body'),
}

async function describeSynchronizationJobsWithOptions(request: DescribeSynchronizationJobsRequest, runtime: Util.RuntimeOptions): DescribeSynchronizationJobsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNum)) {
    query['PageNum'] = request.pageNum;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.synchronizationJobName)) {
    query['SynchronizationJobName'] = request.synchronizationJobName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSynchronizationJobs',
    version = '2016-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeSynchronizationJobs(request: DescribeSynchronizationJobsRequest): DescribeSynchronizationJobsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSynchronizationJobsWithOptions(request, runtime);
}

model DescribeSynchronizationObjectModifyStatusRequest {
  clientToken?: string(name='ClientToken'),
  ownerId?: string(name='OwnerId'),
  taskId?: string(name='TaskId'),
}

model DescribeSynchronizationObjectModifyStatusResponseBody = {
  dataInitializationStatus?: {
    errorMessage?: string(name='ErrorMessage'),
    percent?: string(name='Percent'),
    progress?: string(name='Progress'),
    status?: string(name='Status'),
  }(name='DataInitializationStatus'),
  dataSynchronizationStatus?: {
    delay?: string(name='Delay'),
    errorMessage?: string(name='ErrorMessage'),
    percent?: string(name='Percent'),
    status?: string(name='Status'),
  }(name='DataSynchronizationStatus'),
  errorMessage?: string(name='ErrorMessage'),
  precheckStatus?: {
    detail?: [ 
      {
        checkStatus?: string(name='CheckStatus'),
        errorMessage?: string(name='ErrorMessage'),
        itemName?: string(name='ItemName'),
        repairMethod?: string(name='RepairMethod'),
      }
    ](name='Detail'),
    percent?: string(name='Percent'),
    status?: string(name='Status'),
  }(name='PrecheckStatus'),
  requestId?: string(name='RequestId'),
  status?: string(name='Status'),
  structureInitializationStatus?: {
    errorMessage?: string(name='ErrorMessage'),
    percent?: string(name='Percent'),
    progress?: string(name='Progress'),
    status?: string(name='Status'),
  }(name='StructureInitializationStatus'),
}

model DescribeSynchronizationObjectModifyStatusResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeSynchronizationObjectModifyStatusResponseBody(name='body'),
}

async function describeSynchronizationObjectModifyStatusWithOptions(request: DescribeSynchronizationObjectModifyStatusRequest, runtime: Util.RuntimeOptions): DescribeSynchronizationObjectModifyStatusResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSynchronizationObjectModifyStatus',
    version = '2016-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeSynchronizationObjectModifyStatus(request: DescribeSynchronizationObjectModifyStatusRequest): DescribeSynchronizationObjectModifyStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSynchronizationObjectModifyStatusWithOptions(request, runtime);
}

model ModifyConsumptionTimestampRequest {
  consumptionTimestamp?: string(name='ConsumptionTimestamp'),
  ownerId?: string(name='OwnerId'),
  subscriptionInstanceId?: string(name='SubscriptionInstanceId'),
}

model ModifyConsumptionTimestampResponseBody = {
  errCode?: string(name='ErrCode'),
  errMessage?: string(name='ErrMessage'),
  requestId?: string(name='RequestId'),
  success?: string(name='Success'),
}

model ModifyConsumptionTimestampResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ModifyConsumptionTimestampResponseBody(name='body'),
}

async function modifyConsumptionTimestampWithOptions(request: ModifyConsumptionTimestampRequest, runtime: Util.RuntimeOptions): ModifyConsumptionTimestampResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.consumptionTimestamp)) {
    query['ConsumptionTimestamp'] = request.consumptionTimestamp;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.subscriptionInstanceId)) {
    query['SubscriptionInstanceId'] = request.subscriptionInstanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyConsumptionTimestamp',
    version = '2016-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function modifyConsumptionTimestamp(request: ModifyConsumptionTimestampRequest): ModifyConsumptionTimestampResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyConsumptionTimestampWithOptions(request, runtime);
}

model ModifyMigrationObjectRequest {
  clientToken?: string(name='ClientToken'),
  migrationJobId?: string(name='MigrationJobId'),
  migrationObject?: string(name='MigrationObject'),
  ownerId?: string(name='OwnerId'),
}

model ModifyMigrationObjectResponseBody = {
  errCode?: string(name='ErrCode'),
  errMessage?: string(name='ErrMessage'),
  requestId?: string(name='RequestId'),
  success?: string(name='Success'),
}

model ModifyMigrationObjectResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ModifyMigrationObjectResponseBody(name='body'),
}

async function modifyMigrationObjectWithOptions(request: ModifyMigrationObjectRequest, runtime: Util.RuntimeOptions): ModifyMigrationObjectResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.migrationJobId)) {
    query['MigrationJobId'] = request.migrationJobId;
  }
  if (!Util.isUnset(request.migrationObject)) {
    query['MigrationObject'] = request.migrationObject;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyMigrationObject',
    version = '2016-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function modifyMigrationObject(request: ModifyMigrationObjectRequest): ModifyMigrationObjectResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyMigrationObjectWithOptions(request, runtime);
}

model ModifySubscriptionObjectRequest {
  ownerId?: string(name='OwnerId'),
  subscriptionInstanceId?: string(name='SubscriptionInstanceId'),
  subscriptionObject?: string(name='SubscriptionObject'),
}

model ModifySubscriptionObjectResponseBody = {
  errCode?: string(name='ErrCode'),
  errMessage?: string(name='ErrMessage'),
  requestId?: string(name='RequestId'),
  success?: string(name='Success'),
}

model ModifySubscriptionObjectResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ModifySubscriptionObjectResponseBody(name='body'),
}

async function modifySubscriptionObjectWithOptions(request: ModifySubscriptionObjectRequest, runtime: Util.RuntimeOptions): ModifySubscriptionObjectResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.subscriptionInstanceId)) {
    query['SubscriptionInstanceId'] = request.subscriptionInstanceId;
  }
  if (!Util.isUnset(request.subscriptionObject)) {
    query['SubscriptionObject'] = request.subscriptionObject;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifySubscriptionObject',
    version = '2016-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function modifySubscriptionObject(request: ModifySubscriptionObjectRequest): ModifySubscriptionObjectResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifySubscriptionObjectWithOptions(request, runtime);
}

model ModifySynchronizationObjectRequest {
  ownerId?: string(name='OwnerId'),
  synchronizationJobId?: string(name='SynchronizationJobId'),
  synchronizationObjects?: string(name='SynchronizationObjects'),
}

model ModifySynchronizationObjectResponseBody = {
  errCode?: string(name='ErrCode'),
  errMessage?: string(name='ErrMessage'),
  requestId?: string(name='RequestId'),
  success?: string(name='Success'),
  taskId?: string(name='TaskId'),
}

model ModifySynchronizationObjectResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ModifySynchronizationObjectResponseBody(name='body'),
}

async function modifySynchronizationObjectWithOptions(request: ModifySynchronizationObjectRequest, runtime: Util.RuntimeOptions): ModifySynchronizationObjectResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.synchronizationJobId)) {
    query['SynchronizationJobId'] = request.synchronizationJobId;
  }
  if (!Util.isUnset(request.synchronizationObjects)) {
    query['SynchronizationObjects'] = request.synchronizationObjects;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifySynchronizationObject',
    version = '2016-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function modifySynchronizationObject(request: ModifySynchronizationObjectRequest): ModifySynchronizationObjectResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifySynchronizationObjectWithOptions(request, runtime);
}

model StartMigrationJobRequest {
  migrationJobId?: string(name='MigrationJobId'),
  ownerId?: string(name='OwnerId'),
}

model StartMigrationJobResponseBody = {
  errCode?: string(name='ErrCode'),
  errMessage?: string(name='ErrMessage'),
  requestId?: string(name='RequestId'),
  success?: string(name='Success'),
}

model StartMigrationJobResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: StartMigrationJobResponseBody(name='body'),
}

async function startMigrationJobWithOptions(request: StartMigrationJobRequest, runtime: Util.RuntimeOptions): StartMigrationJobResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.migrationJobId)) {
    query['MigrationJobId'] = request.migrationJobId;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'StartMigrationJob',
    version = '2016-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function startMigrationJob(request: StartMigrationJobRequest): StartMigrationJobResponse {
  var runtime = new Util.RuntimeOptions{};
  return startMigrationJobWithOptions(request, runtime);
}

model StartSubscriptionInstanceRequest {
  ownerId?: string(name='OwnerId'),
  subscriptionInstanceId?: string(name='SubscriptionInstanceId'),
}

model StartSubscriptionInstanceResponseBody = {
  errCode?: string(name='ErrCode'),
  errMessage?: string(name='ErrMessage'),
  requestId?: string(name='RequestId'),
  success?: string(name='Success'),
  taskId?: string(name='TaskId'),
}

model StartSubscriptionInstanceResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: StartSubscriptionInstanceResponseBody(name='body'),
}

async function startSubscriptionInstanceWithOptions(request: StartSubscriptionInstanceRequest, runtime: Util.RuntimeOptions): StartSubscriptionInstanceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.subscriptionInstanceId)) {
    query['SubscriptionInstanceId'] = request.subscriptionInstanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'StartSubscriptionInstance',
    version = '2016-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function startSubscriptionInstance(request: StartSubscriptionInstanceRequest): StartSubscriptionInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return startSubscriptionInstanceWithOptions(request, runtime);
}

model StartSynchronizationJobRequest {
  ownerId?: string(name='OwnerId'),
  synchronizationJobId?: string(name='SynchronizationJobId'),
}

model StartSynchronizationJobResponseBody = {
  errCode?: string(name='ErrCode'),
  errMessage?: string(name='ErrMessage'),
  requestId?: string(name='RequestId'),
  success?: string(name='Success'),
}

model StartSynchronizationJobResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: StartSynchronizationJobResponseBody(name='body'),
}

async function startSynchronizationJobWithOptions(request: StartSynchronizationJobRequest, runtime: Util.RuntimeOptions): StartSynchronizationJobResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.synchronizationJobId)) {
    query['SynchronizationJobId'] = request.synchronizationJobId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'StartSynchronizationJob',
    version = '2016-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function startSynchronizationJob(request: StartSynchronizationJobRequest): StartSynchronizationJobResponse {
  var runtime = new Util.RuntimeOptions{};
  return startSynchronizationJobWithOptions(request, runtime);
}

model StopMigrationJobRequest {
  clientToken?: string(name='ClientToken'),
  migrationJobId?: string(name='MigrationJobId'),
  ownerId?: string(name='OwnerId'),
}

model StopMigrationJobResponseBody = {
  errCode?: string(name='ErrCode'),
  errMessage?: string(name='ErrMessage'),
  requestId?: string(name='RequestId'),
  success?: string(name='Success'),
}

model StopMigrationJobResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: StopMigrationJobResponseBody(name='body'),
}

async function stopMigrationJobWithOptions(request: StopMigrationJobRequest, runtime: Util.RuntimeOptions): StopMigrationJobResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.migrationJobId)) {
    query['MigrationJobId'] = request.migrationJobId;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'StopMigrationJob',
    version = '2016-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function stopMigrationJob(request: StopMigrationJobRequest): StopMigrationJobResponse {
  var runtime = new Util.RuntimeOptions{};
  return stopMigrationJobWithOptions(request, runtime);
}

model SuspendMigrationJobRequest {
  clientToken?: string(name='ClientToken'),
  migrationJobId?: string(name='MigrationJobId'),
  ownerId?: string(name='OwnerId'),
}

model SuspendMigrationJobResponseBody = {
  errCode?: string(name='ErrCode'),
  errMessage?: string(name='ErrMessage'),
  requestId?: string(name='RequestId'),
  success?: string(name='Success'),
}

model SuspendMigrationJobResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SuspendMigrationJobResponseBody(name='body'),
}

async function suspendMigrationJobWithOptions(request: SuspendMigrationJobRequest, runtime: Util.RuntimeOptions): SuspendMigrationJobResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.migrationJobId)) {
    query['MigrationJobId'] = request.migrationJobId;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SuspendMigrationJob',
    version = '2016-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function suspendMigrationJob(request: SuspendMigrationJobRequest): SuspendMigrationJobResponse {
  var runtime = new Util.RuntimeOptions{};
  return suspendMigrationJobWithOptions(request, runtime);
}

model SuspendSynchronizationJobRequest {
  ownerId?: string(name='OwnerId'),
  synchronizationJobId?: string(name='SynchronizationJobId'),
}

model SuspendSynchronizationJobResponseBody = {
  errCode?: string(name='ErrCode'),
  errMessage?: string(name='ErrMessage'),
  requestId?: string(name='RequestId'),
  success?: string(name='Success'),
}

model SuspendSynchronizationJobResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SuspendSynchronizationJobResponseBody(name='body'),
}

async function suspendSynchronizationJobWithOptions(request: SuspendSynchronizationJobRequest, runtime: Util.RuntimeOptions): SuspendSynchronizationJobResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.synchronizationJobId)) {
    query['SynchronizationJobId'] = request.synchronizationJobId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SuspendSynchronizationJob',
    version = '2016-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function suspendSynchronizationJob(request: SuspendSynchronizationJobRequest): SuspendSynchronizationJobResponse {
  var runtime = new Util.RuntimeOptions{};
  return suspendSynchronizationJobWithOptions(request, runtime);
}

